<!DOCTYPE html>
<html>
	<head>
		<!-- Meta -->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<!-- End of Meta -->
		
		<!-- Page title -->
<title>杭州先行科技</title>
		<!-- End of Page title -->
		
		<!-- Libraries -->
		<link type="text/css" href="<?php echo base_url('theme/admin/css/login.css');?>" rel="stylesheet" />	
		<link type="text/css" href="<?php echo base_url('theme/admin/css/smoothness/jquery-ui-1.7.2.custom.html');?>" rel="stylesheet" />	
		
		<script type="text/javascript" src="<?php echo base_url('theme/admin/js/jquery-1.3.2.min.js');?>"></script>
		<script type="text/javascript" src="<?php echo base_url('theme/admin/js/easyTooltip.js');?>"></script>
		<script type="text/javascript" src="<?php echo base_url('theme/admin/js/jquery-ui-1.7.2.custom.min.js');?>"></script>
        <script type="text/javascript" src="<?php echo base_url('theme/ios/iOSdialogBox.js');?>"></script>
        <script type="text/javascript" src="<?php echo base_url('theme/admin/js/system.js');?>"></script>
        <link type="text/css" href="<?php echo base_url('theme/ios/iOSdialogBox.css');?>" rel="stylesheet" />
        <script language="javascript" type="text/javascript">
		if (window.top!=window.self){
			window.top.location.href='<?php site_url('user/login');?>';
		}
		function posts()
		{
			var username = trim($('#username').val());
			var password = trim($('#password').val());
			if(username == ''){ post_false('用户名不能为空'); return false; }
			if(password == ''){ post_false('密码不能为空');   return false; }
			$.ajax({ 
				type:'post',//可选get   
				url:'<?php echo site_url('user/ajax_login');?>',//这里是接收数据的PHP程序   
				data:'username='+username+'&password='+password,//传给PHP的数据，多个参数用&连接   
				dataType:'json',//服务器返回的数据类型 可选XML ,Json jsonp script html text等   
				success:function(msg){
					if(msg.type)
					{ 
						post_true();
					}
					else
					{
						post_false(msg.msg);
					}
				},   
				error:function(){   
					post_false();
				}   
			})
			return false;
		}
		function post_true(){
			$(this).iOSdialogBoxAlert({
			'title'   : '系统提示' ,
			'message' : '登陆成功，自动转到管理页面' ,
			'button' : '确定' ,
			},respuesta);
			return false;
		}
		function post_false(data){
			$(this).iOSdialogBoxAlert({
			'title'   : '系统提示' ,
			'message' : '登陆失败:'+data ,
			'button' : '确定' ,
			});
			return false;
		}			
		function respuesta()
		{
			setTimeout("window.location='<?php echo site_url('frame/home');?>'", 0 * 1000);
		}
		</script>
		<!-- End of Libraries -->	
	</head>
	<body>
	<div id="container">
		<div class="logo">
			<a href="#"><img src="<?php echo base_url('theme/admin/assets/logo.png');?>" alt="" /></a>
		</div>
		<div id="box">
			<form onSubmit="return posts()">
			<p class="main">
				<label>Username: </label>
				<input name="username" id="username" value=""/> 
				<label>Password: </label>
				<input type="password" name="password" id="password" value="">	
			</p>

			<p class="space">
				<!--<span><input type="checkbox" />Remember me</span>-->
				<input type="submit" onclick="posts()" value="Login" class="login" />
			</p>
			</form>
		</div>
	</div>

	</body>
</html>